<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">

<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">

<meta HTTP-EQUIV="expires" CONTENT="0">

<!-- <meta http-equiv="x-ua-compatible" content="IE=9" >  -->
<link rel="shortcut icon" href="<%=request.getContextPath()%>/image/LOGO.png" type="image/x-icon" />
<meta name="copyright" content="All Rights Reserved, Copyright (C) 2013, Wuyeguo, Ltd." /> 
<title>无纸化病案管理系统</title>

<!-- easyui -->
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/themes/icon.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/plugins/datagrid-filter/datagrid-filter.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery-easyui-1.4.5/jquery.easyui.extend.js"></script>

<!-- zTree_v3 -->
<link rel="stylesheet" href="<%=request.getContextPath()%>/script/zTree_v3/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/zTree_v3/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/zTree_v3/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/zTree_v3/js/jquery.ztree.exedit.js"></script>

<!-- JQuery -->
<script type="text/javascript" src='<%=request.getContextPath()%>/script/jquery/jquery-1.10.2.min.js'></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/jquery-ui.min.js"></script>

<!-- viewer 翻拍-->
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.iviewer.css"/>
<script type="text/javascript" src='<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.mousewheel.min.js'></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/viewer/jquery.iviewer.js"></script>

<!-- media PDF查看-->
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/media/jquery.media.js" ></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/media/jquery.metadata.js" ></script>

<!-- slides 图片轮播-->
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/slides/responsiveslides.min.js"></script>

<!-- zoom 图片放大镜 -->
<script type="text/javascript" src='<%=request.getContextPath()%>/script/jquery/plug/zoom/jquery.zoom.js'></script>

<!-- spectrum 颜色选择器 -->
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/script/jquery/plug/jqueryColour/spectrum.css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/jqueryColour/spectrum.js"></script>

<!-- rotate 图片旋转 -->
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/rotate/js/jQueryRotate.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/jquery/plug/easing/jquery.easing.1.3.js"></script>

<!-- common -->

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/index.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/util.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/public.css" /> 
<script type="text/javascript" src="<%=request.getContextPath()%>/script/util.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/script/json.js"></script>


<%-- 
<!--  使IE5,IE6,IE7,IE8兼容到IE9模式 -->
<!–[if lt IE 9]>
<script src=”http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js”></script>
<![endif]–>
--%>
 	      
</head>
<body class="easyui-layout"  onload="checkLoad()">
    
    <!-- header start -->  
	<div class="header"  data-options="region:'north',border:false,split:true">
    	<div class="header-left">
    		<table>
	    		<tr>
	    			<td style="height:80px;text-align:center"><img src="<%=request.getContextPath()%>/image/index-logo.png"/></td>
	    			<td><span class="titleFont">无纸化病案管理系统</span></td>
	    		</tr>	
    		</table>
        </div>
        
        <table class="header-right">
         <tr>
			<td class="index_td"><img src="<%=request.getContextPath()%>/image/picture.png" /></td>
			<td class="index_tdInfo" id="fcode"><span class="infoFont">${loginUser.fcode}</span></td>
			<td class="index_td"><img src="<%=request.getContextPath()%>/image/deptPicture.png" /></td>
			<td class="index_tdInfo">
				<c:choose>
           			<c:when test="${loginUser.ffzname eq null && loginUser.fksname eq null && empty loginUser.ffzname && empty loginUser.fksname}">
            				<span  class="infoFont">超级管理员</span>
           			</c:when>
           			<c:when test="${loginUser.ffzname eq null || empty loginUser.ffzname}">
           				<span  class="infoFont">${loginUser.fksname}</span>
           			</c:when>
           			<c:when test="${loginUser.fksname eq null || empty loginUser.fksname}">
           				<span  class="infoFont">${loginUser.ffzname}</span>
           			</c:when>
           			<c:otherwise>
           				<span  class="infoFont">${loginUser.ffzname}</span>
           			</c:otherwise>
	            </c:choose>
			</td>
			<td class="index_td"><img  src="<%=request.getContextPath()%>/image/outBtn3.png" /></td>
			<td class="index_tdInfo"><a id="outLogin" href="javascript:void(0);"  class="infoFont">退出登录</a></td>
		</tr>
        </table>
	        
    </div>
    <!-- header end --> 
	
	<!-- 左边导航栏 start -->
	<div class="navigate" data-options="region:'west',split:true,border:true,maxWidth:200,minWidth:170" iconCls="" title='系统导航'> 
    	<div id="accordion" class="easyui-accordion" data-options="border:false,fit:true"	> 
    	
        </div>
    </div>	
	<!-- 左边导航栏 end -->
	
	<!-- 中间编辑页面 start -->
	<div class="main" data-options="region:'center'" >
    	 <div id="tabs" class="" data-options="border:false,fit:true">  </div>
    	 <div id="index_prompt" class="easyui-dialog" title="提示" data-options="modal:true,closed:true,closable: false" style="width:500px;height:80px;padding:10px;">
			正在执行，请稍等...
		</div>
    </div>
	<!-- 中间编辑页面 end -->
	
	<!-- 页脚 start -->
	<div class="footer" data-options="region:'south',border:true,split:true">
    	&copy; 2017 卫宁中天  All Rights Reserved
    </div>
    <!-- 页脚 end -->  
    
    <script type="text/javascript">
   
    	var ctx = "<%=request.getContextPath()%>"; //根路径
    	var sysFcode = '${loginUser.fcode}'; //系统用户编码
    	var sysFbqdm = '${loginUser.fbqdm}'; //系统用户默认病区编码
    	//退出登录
    	$("#outLogin").click(function(){
    		$.ajax({
    			url:ctx + '/outLogin',
    			dataType:'json',
    			type:'POST',
    			success:function(data){
    				if(data.success ==true){
    					window.location.href = ctx + "/login";
    				}else{
    					alert("退出登录失败，请联系管理员!");
    				}
    			},error:function(){
    				alert("退出登录失败，请联系管理员!");
    			}
    		});
    	});
    	
    	//页面刷新之后执行的事件
    	function checkLoad(){
    	/* 	$.ajax({
					url : ctx + '/MedicalShootManage/deleteTemporaryFolder',
					dataType:'json',
					type:'post',
					data:{
						fcode :$("#fcode").text()
					},
					success:function(data){
						if(data == true){
						//alert("删除图片成功！");
						}else{
						//	alert("文件不存在！");
						}
					},
					error:function(){
						$.messager.alert("提示","index页面删除图片功能异常，请联系管理员！","info");
					}
					
				}); */
    	}
    	
   //关闭页面后删除服务器存放临时图片的文件夹
   	 $("#tabs").tabs({
   		 onClose:function(title,index){
   			if(title == "数字化病案浏览" || title == "数字化病案审核" || title == "数字化病案拍摄"){
   				$.ajax({
   					url : ctx + '/MedicalShootManage/deleteTemporaryFolder',
   					dataType:'json',
   					type:'post',
   					data:{
   						fcode :$("#fcode").text()
   					},
   					success:function(data){
   						//alert("删除图片成功！");
   					},
   					error:function(){
   						$.messager.alert("提示","删除图片失败，请联系管理员！","info");
   					}
   					
   				});
   			}
   		}
   	}); 
    	
    	$(function(){
    		//初始化导航菜单
    		$('#accordion').accordion({    
    			fillSpace:true,
				fit:true,
				border:false,
        	    animate:false   
        	}); 
    		
    		//请求后台获取数据
			$.post(ctx + "/getMenu",function(data){
				$.each(data, function (i, e) {//循环创建手风琴的项
					var id = e.fcode;
					$('#accordion').accordion('add',{
						title: e.text,
						content:"<ul id='tree" + id +"' class='easyui-tree wu-side-tree" +"'></ul>",
						selected: true,
						iconCls:"icon-blank" 
					});
					$("#tree" + id).tree({
						data : e.children,
						iconCls:e.iconCls,
						onClick : function(node){ 
				 			var tabTitle = node.text;
							var url = ctx + node.attributes;
							var icon = node.iconCls;
							if(node.attributes!=null && node.attributes!=""){
				 				addTab(tabTitle, url, icon, false, true); 
				 			}else{
				 				if(node.fhavechildren==0){//没有子节点
				 					$.messager.alert("提示","未设置访问URL！","info");
				 				}
				 			}
						}
					});
				});
				$('#accordion').accordion("select",data[0].text);
			},"json");
    	});
    </script>
</body>
</html>
